package com.hznu.ez4life.modules.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.hznu.ez4life.modules.service.ItemtypeService;
import com.hznu.ez4life.myBeans.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author DragonDoor
 * @since 2019-07-25
 */
@RestController
@EnableAutoConfiguration
@RequestMapping("/itemtype")
public class ItemtypeController {

    @Autowired
    ItemtypeService itemtypeService;

    @GetMapping("/findAll")
    public R findAll()
    {
        try
        {
            return R.ok().put("itemTypeList",itemtypeService.selectList(new EntityWrapper<>()));
        }catch(Exception e)
        {
            return R.error();
        }
    }

}

